﻿using FastExecutor.Base.Design;
using FastExecutor.Base.Model;
using Newtonsoft.Json.Linq;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Web.Mvc;

namespace FastExecutor.ORG.Controller
{
    [RouteArea("Frame")]
    [RoutePrefix("Demo")]
    public class DemoController : BaseController
    {
        [Route("NoticeMoreList")]
        public ActionResult NoticeMoreList()
        {
            return View("~/Views/Frame/Demo/NoticeMore_List.cshtml");
        }

        [Route("NoticeDetail")]
        public ActionResult NoticeDetail()
        {
            return View("~/Views/Frame/Demo/NoticeDetail.cshtml");
        }

        [Route("FindNoticeData")]
        public ActionResult FindNoticeData()
        {
            ReturnValue result = new ReturnValue();
            JObject Params = GetParams();
            JArray array = new JArray();
            JObject obj = new JObject();
            obj.Add("title", "关于2019XXX节日的放假通知");
            obj.Add("publishdate", DateTime.Now.AddDays(-1).ToString("yyyy-MM-dd"));
            obj.Add("publishuname", "行政管理中心");
            obj.Add("index",1);
            array.Add(obj);
            obj = new JObject();
            obj.Add("title", "XXXXXX公司人事任免决定通知");
            obj.Add("publishdate", DateTime.Now.AddDays(-2).ToString("yyyy-MM-dd"));
            obj.Add("publishuname", "人事部");
            obj.Add("index", 2);
            array.Add(obj);
            obj = new JObject();
            obj.Add("title", "XXXXXX公司培训计划（2019第三季度）");
            obj.Add("publishdate", DateTime.Now.AddDays(-3).ToString("yyyy-MM-dd"));
            obj.Add("publishuname", "研发部");
            obj.Add("index", 3);
            array.Add(obj);
            obj = new JObject();
            obj.Add("title", "关于参观庆祝中华人民共和国成立70周年成就展的通知");
            obj.Add("publishdate", DateTime.Now.AddDays(-4).ToString("yyyy-MM-dd"));
            obj.Add("publishuname", "行政管理中心");
            obj.Add("index", 4);
            array.Add(obj);
            obj = new JObject();
            obj.Add("title", "XXXXX公司员工福利薪酬待遇v2.0发布通知");
            obj.Add("publishdate", DateTime.Now.AddDays(-5).ToString("yyyy-MM-dd"));
            obj.Add("publishuname", "王程阳");
            obj.Add("index", 5);
            array.Add(obj);
            result.Add("data", array);
            return result;
        }
    }
}
